package com.noreply.timer.controller;

import com.noreply.timer.dao.TaskDao;
import com.noreply.timer.entity.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author noreply
 * @description
 * @datetime 2021/7/2 21:21
 */
@RestController
@RequestMapping("/task")
public class TaskController {
    @Autowired
    private TaskDao taskDao;

    @GetMapping("/add")
    public Object addTask() {
        Task task = new Task();
        task.setName("my first task");
        task.setProjectId(1L);
        task.setScheduleId(1L);
        return taskDao.save(task);
    }
}
